<?php
require_once("conn.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>作业列表</title>
    <style>
    table {
        width: 100%;
        border-collapse: collapse;
    }
    
    th, td {
        padding: 8px;
        text-align: left;
        border-bottom: 1px solid #ddd;
    }
    
    th {
        background-color: #f2f2f2;
    }
    
    tr:nth-child(even) {
        background-color: #f9f9f9;
    }
    
    .actions a {
        margin-right: 5px;
        color: #333;
        text-decoration: none;
    }
    
    .actions a.accept {
        color: green;
    }
    
    .actions a.cancel {
        color: red;
    }
    
    .actions a.complete {
        color: blue;
    }
    </style>
</head>
<body>
        <div class="customer-manage-table" style="text-align: center;">
            <table>
                <thead>
                    <tr>
                        <th>作业名称</th>
                        <th>作业内容</th>
                    </tr>
                </thead>
                <tbody>
                    <?php
                    // if (isset($_COOKIE['account'])) {
                    //     echo "<tr><td colspan='8'>账号：" . $_COOKIE['account'] . "</td></tr>";
                    // }
            
                    $result = mysqli_query($conn, "SELECT * FROM homework ");
            
                    while ($row = mysqli_fetch_array($result)) {
                        ?>
                        <tr>
                            <td><?php echo $row['id']; ?></td>
                            <td><?php echo $row['content']; ?></td>
                            <td class="actions">
                                <a class="cancel" href="funtion/rider-change.php?id=<?php echo $row['id']; ?>">提交作业</a>
                            </td>
                        </tr>
                    <?php
                    }
                    mysqli_close($conn);
                    ?>
                </tbody>
            </table>
        </div>
        <br><br>
    </div>
</body>
</html>